


<!DOCTYPE html>
<html>
  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>AnAL/AnAL.lua at master from bartbes/love-misc-libs - GitHub</title>
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
    <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

    
    

    <meta content="authenticity_token" name="csrf-param" />
<meta content="NdjybNZAbrxVlXM2APPdC56t2/3Hu913CDoMfULASNo=" name="csrf-token" />

    <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-0f5d10af676d074065ebd360de4c996d8dcfdfa6.css" media="screen" rel="stylesheet" type="text/css" />
    <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github2-c8953385bc6ea8acd3cff5df9bfcce0ea118ad47.css" media="screen" rel="stylesheet" type="text/css" />
    

    <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/jquery-1ff4761a0d9866a948321eac8d969db3dc12938e.js" type="text/javascript"></script>
    <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/github-f18e47f6b8ff4e1edebdac2dc35b1ef0fb0eeae0.js" type="text/javascript"></script>
    

      <link rel='permalink' href='/bartbes/love-misc-libs/blob/88979a881b39efbe4a43707012baf3fffd6eb462/AnAL/AnAL.lua'>
    <meta property="og:title" content="love-misc-libs"/>
    <meta property="og:type" content="githubog:gitrepository"/>
    <meta property="og:url" content="https://github.com/bartbes/love-misc-libs"/>
    <meta property="og:image" content="https://a248.e.akamai.net/assets.github.com/images/gravatars/gravatar-140.png?1329275898"/>
    <meta property="og:site_name" content="GitHub"/>
    <meta property="og:description" content="love-misc-libs - Just some random libs I have lying around, now with version control!"/>

    <meta name="description" content="love-misc-libs - Just some random libs I have lying around, now with version control!" />
  <link href="https://github.com/bartbes/love-misc-libs/commits/master.atom" rel="alternate" title="Recent Commits to love-misc-libs:master" type="application/atom+xml" />

  </head>


  <body class="logged_out page-blob windows vis-public env-production ">
    


    

      <div id="header" class="true clearfix">
        <div class="container clearfix">
          <a class="site-logo" href="https://github.com">
            <!--[if IE]>
            <img alt="GitHub" class="github-logo" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7.png?1323882736" />
            <img alt="GitHub" class="github-logo-hover" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7-hover.png?1324325373" />
            <![endif]-->
            <img alt="GitHub" class="github-logo-4x" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x.png?1323882736" />
            <img alt="GitHub" class="github-logo-4x-hover" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x-hover.png?1324325373" />
          </a>

                  <!--
      make sure to use fully qualified URLs here since this nav
      is used on error pages on other domains
    -->
    <ul class="top-nav logged_out">
        <li class="pricing"><a href="https://github.com/plans">Signup and Pricing</a></li>
        <li class="explore"><a href="https://github.com/explore">Explore GitHub</a></li>
      <li class="features"><a href="https://github.com/features">Features</a></li>
        <li class="blog"><a href="https://github.com/blog">Blog</a></li>
      <li class="login"><a href="https://github.com/login?return_to=%2Fbartbes%2Flove-misc-libs%2Fblob%2Fmaster%2FAnAL%2FAnAL.lua">Login</a></li>
    </ul>



          
        </div>
      </div>

      

            <div class="site">
      <div class="container">
        <div class="pagehead repohead instapaper_ignore readability-menu">
        <div class="title-actions-bar">
          <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/bartbes" itemprop="url">            <span itemprop="title">bartbes</span>
            </a> /
            <strong><a href="/bartbes/love-misc-libs" class="js-current-repository">love-misc-libs</a></strong>
          </h1>
          



              <ul class="pagehead-actions">


          <li><a href="/login?return_to=%2Fbartbes%2Flove-misc-libs" class="minibutton btn-watch watch-button entice tooltipped leftwards" rel="nofollow" title="You must be logged in to use this feature"><span><span class="icon"></span>Watch</span></a></li>
          <li><a href="/login?return_to=%2Fbartbes%2Flove-misc-libs" class="minibutton btn-fork fork-button entice tooltipped leftwards" rel="nofollow" title="You must be logged in to use this feature"><span><span class="icon"></span>Fork</span></a></li>


      <li class="repostats">
        <ul class="repo-stats">
          <li class="watchers ">
            <a href="/bartbes/love-misc-libs/watchers" title="Watchers" class="tooltipped downwards">
              7
            </a>
          </li>
          <li class="forks">
            <a href="/bartbes/love-misc-libs/network" title="Forks" class="tooltipped downwards">
              2
            </a>
          </li>
        </ul>
      </li>
    </ul>

        </div>

          

  <ul class="tabs">
    <li><a href="/bartbes/love-misc-libs" class="selected" highlight="repo_sourcerepo_downloadsrepo_commitsrepo_tagsrepo_branches">Code</a></li>
    <li><a href="/bartbes/love-misc-libs/network" highlight="repo_networkrepo_fork_queue">Network</a>
    <li><a href="/bartbes/love-misc-libs/pulls" highlight="repo_pulls">Pull Requests <span class='counter'>0</span></a></li>

      <li><a href="/bartbes/love-misc-libs/issues" highlight="repo_issues">Issues <span class='counter'>0</span></a></li>


    <li><a href="/bartbes/love-misc-libs/graphs" highlight="repo_graphsrepo_contributors">Stats &amp; Graphs</a></li>

  </ul>

  
<div class="frame frame-center tree-finder" style="display:none"
      data-tree-list-url="/bartbes/love-misc-libs/tree-list/88979a881b39efbe4a43707012baf3fffd6eb462"
      data-blob-url-prefix="/bartbes/love-misc-libs/blob/88979a881b39efbe4a43707012baf3fffd6eb462"
    >

  <div class="breadcrumb">
    <span class="bold"><a href="/bartbes/love-misc-libs">love-misc-libs</a></span> /
    <input class="tree-finder-input js-navigation-enable" type="text" name="query" autocomplete="off" spellcheck="false">
  </div>

    <div class="octotip">
      <p>
        <a href="/bartbes/love-misc-libs/dismiss-tree-finder-help" class="dismiss js-dismiss-tree-list-help" title="Hide this notice forever" rel="nofollow">Dismiss</a>
        <span class="bold">Octotip:</span> You've activated the <em>file finder</em>
        by pressing <span class="kbd">t</span> Start typing to filter the
        file list. Use <span class="kbd badmono">↑</span> and
        <span class="kbd badmono">↓</span> to navigate,
        <span class="kbd">enter</span> to view files.
      </p>
    </div>

  <table class="tree-browser" cellpadding="0" cellspacing="0">
    <tr class="js-header"><th>&nbsp;</th><th>name</th></tr>
    <tr class="js-no-results no-results" style="display: none">
      <th colspan="2">No matching files</th>
    </tr>
    <tbody class="js-results-list js-navigation-container">
    </tbody>
  </table>
</div>

<div id="jump-to-line" style="display:none">
  <h2>Jump to Line</h2>
  <form>
    <input class="textfield" type="text">
    <div class="full-button">
      <button type="submit" class="classy">
        <span>Go</span>
      </button>
    </div>
  </form>
</div>


<div class="subnav-bar">

  <ul class="actions subnav">
    <li><a href="/bartbes/love-misc-libs/tags" class="" highlight="repo_tags">Tags <span class="counter">1</span></a></li>
    <li><a href="/bartbes/love-misc-libs/downloads" class="blank downloads-blank" highlight="repo_downloads">Downloads <span class="counter">0</span></a></li>
    
  </ul>

  <ul class="scope">
    <li class="switcher">

      <div class="context-menu-container js-menu-container">
        <a href="#"
           class="minibutton bigger switcher js-menu-target js-commitish-button btn-branch repo-tree"
           data-master-branch="master"
           data-ref="master">
          <span><span class="icon"></span><i>branch:</i> master</span>
        </a>

        <div class="context-pane commitish-context js-menu-content">
          <a href="javascript:;" class="close js-menu-close"></a>
          <div class="context-title">Switch Branches/Tags</div>
          <div class="context-body pane-selector commitish-selector js-filterable-commitishes">
            <div class="filterbar">
              <div class="placeholder-field js-placeholder-field">
                <label class="placeholder" for="context-commitish-filter-field" data-placeholder-mode="sticky">Filter branches/tags</label>
                <input type="text" id="context-commitish-filter-field" class="commitish-filter" />
              </div>

              <ul class="tabs">
                <li><a href="#" data-filter="branches" class="selected">Branches</a></li>
                <li><a href="#" data-filter="tags">Tags</a></li>
              </ul>
            </div>

              <div class="commitish-item branch-commitish selector-item">
                <h4>
                    <a href="/bartbes/love-misc-libs/blob/master/AnAL/AnAL.lua" data-name="master" rel="nofollow">master</a>
                </h4>
              </div>

              <div class="commitish-item tag-commitish selector-item">
                <h4>
                    <a href="/bartbes/love-misc-libs/blob/LUBE-1.0/AnAL/AnAL.lua" data-name="LUBE-1.0" rel="nofollow">LUBE-1.0</a>
                </h4>
              </div>

            <div class="no-results" style="display:none">Nothing to show</div>
          </div>
        </div><!-- /.commitish-context-context -->
      </div>

    </li>
  </ul>

  <ul class="subnav with-scope">

    <li><a href="/bartbes/love-misc-libs" class="selected" highlight="repo_source">Files</a></li>
    <li><a href="/bartbes/love-misc-libs/commits/master" highlight="repo_commits">Commits</a></li>
    <li><a href="/bartbes/love-misc-libs/branches" class="" highlight="repo_branches" rel="nofollow">Branches <span class="counter">1</span></a></li>
  </ul>

</div>

  
  
  


          

        </div><!-- /.repohead -->

        




  
  <p class="last-commit">Latest commit to the <strong>master</strong> branch</p>

<div class="commit commit-tease js-details-container">
  <p class="commit-title ">
      <a href="/bartbes/love-misc-libs/commit/88979a881b39efbe4a43707012baf3fffd6eb462" class="message">Add Simplified BSD license</a>
      
  </p>
  <div class="commit-meta">
    <a href="/bartbes/love-misc-libs/commit/88979a881b39efbe4a43707012baf3fffd6eb462" class="sha-block">commit <span class="sha">88979a881b</span></a>
    <span class="js-clippy clippy-button " data-clipboard-text="88979a881b39efbe4a43707012baf3fffd6eb462" data-copied-hint="copied!" data-copy-hint="Copy SHA"></span>

    <div class="authorship">
      <img class="gravatar" height="20" src="https://secure.gravatar.com/avatar/4459117808d601a15a4ff2a1db3a620d?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" width="20" />
      <span class="author-name"><a href="/bartbes">bartbes</a></span>
      authored <time class="js-relative-date" datetime="2011-12-06T09:08:33-08:00" title="2011-12-06 09:08:33">December 06, 2011</time>

    </div>
  </div>
</div>


<!-- block_view_fragment_key: views4/v8/blob:v17:5c077808da1f2e8413b5b241aec46859 -->
  <div id="slider">

    <div class="breadcrumb" data-path="AnAL/AnAL.lua/">
      <b itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/bartbes/love-misc-libs/tree/88979a881b39efbe4a43707012baf3fffd6eb462" class="js-rewrite-sha" itemprop="url"><span itemprop="title">love-misc-libs</span></a></b> / <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/bartbes/love-misc-libs/tree/88979a881b39efbe4a43707012baf3fffd6eb462/AnAL" class="js-rewrite-sha" itemscope="url"><span itemprop="title">AnAL</span></a></span> / AnAL.lua <span class="js-clippy clippy-button " data-clipboard-text="AnAL/AnAL.lua" data-copied-hint="copied!" data-copy-hint="copy to clipboard"></span>
    </div>

    <div class="frames">
      <div class="frame frame-center" data-path="AnAL/AnAL.lua/" data-permalink-url="/bartbes/love-misc-libs/blob/88979a881b39efbe4a43707012baf3fffd6eb462/AnAL/AnAL.lua" data-title="AnAL/AnAL.lua at master from bartbes/love-misc-libs - GitHub" data-type="blob">
          <ul class="big-actions">
            <li><a class="file-edit-link minibutton js-rewrite-sha" href="/bartbes/love-misc-libs/edit/88979a881b39efbe4a43707012baf3fffd6eb462/AnAL/AnAL.lua" data-method="post" rel="nofollow"><span>Edit this file</span></a></li>
          </ul>

        <div id="files" class="bubble">
          <div class="file">
            <div class="meta">
              <div class="info">
                <span class="icon"><img alt="Txt" height="16" src="https://a248.e.akamai.net/assets.github.com/images/icons/txt.png?1310086001" width="16" /></span>
                <span class="mode" title="File Mode">100644</span>
                  <span>204 lines (183 sloc)</span>
                <span>5.885 kb</span>
              </div>
              <ul class="actions">
                <li><a href="/bartbes/love-misc-libs/raw/master/AnAL/AnAL.lua" id="raw-url">raw</a></li>
                  <li><a href="/bartbes/love-misc-libs/blame/master/AnAL/AnAL.lua">blame</a></li>
                <li><a href="/bartbes/love-misc-libs/commits/master/AnAL/AnAL.lua" rel="nofollow">history</a></li>
              </ul>
            </div>
              <div class="data type-lua">
      <table cellpadding="0" cellspacing="0" class="lines">
        <tr>
          <td>
            <pre class="line_numbers"><span id="L1" rel="#L1">1</span>
<span id="L2" rel="#L2">2</span>
<span id="L3" rel="#L3">3</span>
<span id="L4" rel="#L4">4</span>
<span id="L5" rel="#L5">5</span>
<span id="L6" rel="#L6">6</span>
<span id="L7" rel="#L7">7</span>
<span id="L8" rel="#L8">8</span>
<span id="L9" rel="#L9">9</span>
<span id="L10" rel="#L10">10</span>
<span id="L11" rel="#L11">11</span>
<span id="L12" rel="#L12">12</span>
<span id="L13" rel="#L13">13</span>
<span id="L14" rel="#L14">14</span>
<span id="L15" rel="#L15">15</span>
<span id="L16" rel="#L16">16</span>
<span id="L17" rel="#L17">17</span>
<span id="L18" rel="#L18">18</span>
<span id="L19" rel="#L19">19</span>
<span id="L20" rel="#L20">20</span>
<span id="L21" rel="#L21">21</span>
<span id="L22" rel="#L22">22</span>
<span id="L23" rel="#L23">23</span>
<span id="L24" rel="#L24">24</span>
<span id="L25" rel="#L25">25</span>
<span id="L26" rel="#L26">26</span>
<span id="L27" rel="#L27">27</span>
<span id="L28" rel="#L28">28</span>
<span id="L29" rel="#L29">29</span>
<span id="L30" rel="#L30">30</span>
<span id="L31" rel="#L31">31</span>
<span id="L32" rel="#L32">32</span>
<span id="L33" rel="#L33">33</span>
<span id="L34" rel="#L34">34</span>
<span id="L35" rel="#L35">35</span>
<span id="L36" rel="#L36">36</span>
<span id="L37" rel="#L37">37</span>
<span id="L38" rel="#L38">38</span>
<span id="L39" rel="#L39">39</span>
<span id="L40" rel="#L40">40</span>
<span id="L41" rel="#L41">41</span>
<span id="L42" rel="#L42">42</span>
<span id="L43" rel="#L43">43</span>
<span id="L44" rel="#L44">44</span>
<span id="L45" rel="#L45">45</span>
<span id="L46" rel="#L46">46</span>
<span id="L47" rel="#L47">47</span>
<span id="L48" rel="#L48">48</span>
<span id="L49" rel="#L49">49</span>
<span id="L50" rel="#L50">50</span>
<span id="L51" rel="#L51">51</span>
<span id="L52" rel="#L52">52</span>
<span id="L53" rel="#L53">53</span>
<span id="L54" rel="#L54">54</span>
<span id="L55" rel="#L55">55</span>
<span id="L56" rel="#L56">56</span>
<span id="L57" rel="#L57">57</span>
<span id="L58" rel="#L58">58</span>
<span id="L59" rel="#L59">59</span>
<span id="L60" rel="#L60">60</span>
<span id="L61" rel="#L61">61</span>
<span id="L62" rel="#L62">62</span>
<span id="L63" rel="#L63">63</span>
<span id="L64" rel="#L64">64</span>
<span id="L65" rel="#L65">65</span>
<span id="L66" rel="#L66">66</span>
<span id="L67" rel="#L67">67</span>
<span id="L68" rel="#L68">68</span>
<span id="L69" rel="#L69">69</span>
<span id="L70" rel="#L70">70</span>
<span id="L71" rel="#L71">71</span>
<span id="L72" rel="#L72">72</span>
<span id="L73" rel="#L73">73</span>
<span id="L74" rel="#L74">74</span>
<span id="L75" rel="#L75">75</span>
<span id="L76" rel="#L76">76</span>
<span id="L77" rel="#L77">77</span>
<span id="L78" rel="#L78">78</span>
<span id="L79" rel="#L79">79</span>
<span id="L80" rel="#L80">80</span>
<span id="L81" rel="#L81">81</span>
<span id="L82" rel="#L82">82</span>
<span id="L83" rel="#L83">83</span>
<span id="L84" rel="#L84">84</span>
<span id="L85" rel="#L85">85</span>
<span id="L86" rel="#L86">86</span>
<span id="L87" rel="#L87">87</span>
<span id="L88" rel="#L88">88</span>
<span id="L89" rel="#L89">89</span>
<span id="L90" rel="#L90">90</span>
<span id="L91" rel="#L91">91</span>
<span id="L92" rel="#L92">92</span>
<span id="L93" rel="#L93">93</span>
<span id="L94" rel="#L94">94</span>
<span id="L95" rel="#L95">95</span>
<span id="L96" rel="#L96">96</span>
<span id="L97" rel="#L97">97</span>
<span id="L98" rel="#L98">98</span>
<span id="L99" rel="#L99">99</span>
<span id="L100" rel="#L100">100</span>
<span id="L101" rel="#L101">101</span>
<span id="L102" rel="#L102">102</span>
<span id="L103" rel="#L103">103</span>
<span id="L104" rel="#L104">104</span>
<span id="L105" rel="#L105">105</span>
<span id="L106" rel="#L106">106</span>
<span id="L107" rel="#L107">107</span>
<span id="L108" rel="#L108">108</span>
<span id="L109" rel="#L109">109</span>
<span id="L110" rel="#L110">110</span>
<span id="L111" rel="#L111">111</span>
<span id="L112" rel="#L112">112</span>
<span id="L113" rel="#L113">113</span>
<span id="L114" rel="#L114">114</span>
<span id="L115" rel="#L115">115</span>
<span id="L116" rel="#L116">116</span>
<span id="L117" rel="#L117">117</span>
<span id="L118" rel="#L118">118</span>
<span id="L119" rel="#L119">119</span>
<span id="L120" rel="#L120">120</span>
<span id="L121" rel="#L121">121</span>
<span id="L122" rel="#L122">122</span>
<span id="L123" rel="#L123">123</span>
<span id="L124" rel="#L124">124</span>
<span id="L125" rel="#L125">125</span>
<span id="L126" rel="#L126">126</span>
<span id="L127" rel="#L127">127</span>
<span id="L128" rel="#L128">128</span>
<span id="L129" rel="#L129">129</span>
<span id="L130" rel="#L130">130</span>
<span id="L131" rel="#L131">131</span>
<span id="L132" rel="#L132">132</span>
<span id="L133" rel="#L133">133</span>
<span id="L134" rel="#L134">134</span>
<span id="L135" rel="#L135">135</span>
<span id="L136" rel="#L136">136</span>
<span id="L137" rel="#L137">137</span>
<span id="L138" rel="#L138">138</span>
<span id="L139" rel="#L139">139</span>
<span id="L140" rel="#L140">140</span>
<span id="L141" rel="#L141">141</span>
<span id="L142" rel="#L142">142</span>
<span id="L143" rel="#L143">143</span>
<span id="L144" rel="#L144">144</span>
<span id="L145" rel="#L145">145</span>
<span id="L146" rel="#L146">146</span>
<span id="L147" rel="#L147">147</span>
<span id="L148" rel="#L148">148</span>
<span id="L149" rel="#L149">149</span>
<span id="L150" rel="#L150">150</span>
<span id="L151" rel="#L151">151</span>
<span id="L152" rel="#L152">152</span>
<span id="L153" rel="#L153">153</span>
<span id="L154" rel="#L154">154</span>
<span id="L155" rel="#L155">155</span>
<span id="L156" rel="#L156">156</span>
<span id="L157" rel="#L157">157</span>
<span id="L158" rel="#L158">158</span>
<span id="L159" rel="#L159">159</span>
<span id="L160" rel="#L160">160</span>
<span id="L161" rel="#L161">161</span>
<span id="L162" rel="#L162">162</span>
<span id="L163" rel="#L163">163</span>
<span id="L164" rel="#L164">164</span>
<span id="L165" rel="#L165">165</span>
<span id="L166" rel="#L166">166</span>
<span id="L167" rel="#L167">167</span>
<span id="L168" rel="#L168">168</span>
<span id="L169" rel="#L169">169</span>
<span id="L170" rel="#L170">170</span>
<span id="L171" rel="#L171">171</span>
<span id="L172" rel="#L172">172</span>
<span id="L173" rel="#L173">173</span>
<span id="L174" rel="#L174">174</span>
<span id="L175" rel="#L175">175</span>
<span id="L176" rel="#L176">176</span>
<span id="L177" rel="#L177">177</span>
<span id="L178" rel="#L178">178</span>
<span id="L179" rel="#L179">179</span>
<span id="L180" rel="#L180">180</span>
<span id="L181" rel="#L181">181</span>
<span id="L182" rel="#L182">182</span>
<span id="L183" rel="#L183">183</span>
<span id="L184" rel="#L184">184</span>
<span id="L185" rel="#L185">185</span>
<span id="L186" rel="#L186">186</span>
<span id="L187" rel="#L187">187</span>
<span id="L188" rel="#L188">188</span>
<span id="L189" rel="#L189">189</span>
<span id="L190" rel="#L190">190</span>
<span id="L191" rel="#L191">191</span>
<span id="L192" rel="#L192">192</span>
<span id="L193" rel="#L193">193</span>
<span id="L194" rel="#L194">194</span>
<span id="L195" rel="#L195">195</span>
<span id="L196" rel="#L196">196</span>
<span id="L197" rel="#L197">197</span>
<span id="L198" rel="#L198">198</span>
<span id="L199" rel="#L199">199</span>
<span id="L200" rel="#L200">200</span>
<span id="L201" rel="#L201">201</span>
<span id="L202" rel="#L202">202</span>
<span id="L203" rel="#L203">203</span>
</pre>
          </td>
          <td width="100%">
                <div class="highlight"><pre><div class='line' id='LC1'><span class="cm">--[[</span></div><div class='line' id='LC2'><span class="cm">Copyright (c) 2009-2010 Bart Bes</span></div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'><span class="cm">Permission is hereby granted, free of charge, to any person</span></div><div class='line' id='LC5'><span class="cm">obtaining a copy of this software and associated documentation</span></div><div class='line' id='LC6'><span class="cm">files (the &quot;Software&quot;), to deal in the Software without</span></div><div class='line' id='LC7'><span class="cm">restriction, including without limitation the rights to use,</span></div><div class='line' id='LC8'><span class="cm">copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div><div class='line' id='LC9'><span class="cm">copies of the Software, and to permit persons to whom the</span></div><div class='line' id='LC10'><span class="cm">Software is furnished to do so, subject to the following</span></div><div class='line' id='LC11'><span class="cm">conditions:</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'><span class="cm">The above copyright notice and this permission notice shall be</span></div><div class='line' id='LC14'><span class="cm">included in all copies or substantial portions of the Software.</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'><span class="cm">THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></div><div class='line' id='LC17'><span class="cm">EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES</span></div><div class='line' id='LC18'><span class="cm">OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></div><div class='line' id='LC19'><span class="cm">NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span></div><div class='line' id='LC20'><span class="cm">HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,</span></div><div class='line' id='LC21'><span class="cm">WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div><div class='line' id='LC22'><span class="cm">FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR</span></div><div class='line' id='LC23'><span class="cm">OTHER DEALINGS IN THE SOFTWARE.</span></div><div class='line' id='LC24'><span class="cm">]]</span></div><div class='line' id='LC25'><br/></div><div class='line' id='LC26'><span class="kd">local</span> <span class="n">animation</span> <span class="o">=</span> <span class="p">{}</span></div><div class='line' id='LC27'><span class="n">animation</span><span class="p">.</span><span class="n">__index</span> <span class="o">=</span> <span class="n">animation</span></div><div class='line' id='LC28'><br/></div><div class='line' id='LC29'><span class="c1">--- Create a new animation</span></div><div class='line' id='LC30'><span class="c1">-- Replaces love.graphics.newAnimation</span></div><div class='line' id='LC31'><span class="c1">-- @param image The image that contains the frames</span></div><div class='line' id='LC32'><span class="c1">-- @param fw The frame width</span></div><div class='line' id='LC33'><span class="c1">-- @param fh The frame height</span></div><div class='line' id='LC34'><span class="c1">-- @param delay The delay between two frames</span></div><div class='line' id='LC35'><span class="c1">-- @param frames The number of frames, 0 for autodetect</span></div><div class='line' id='LC36'><span class="c1">-- @return The created animation</span></div><div class='line' id='LC37'><span class="k">function</span> <span class="nf">newAnimation</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="n">fw</span><span class="p">,</span> <span class="n">fh</span><span class="p">,</span> <span class="n">delay</span><span class="p">,</span> <span class="n">frames</span><span class="p">)</span></div><div class='line' id='LC38'>	<span class="kd">local</span> <span class="n">a</span> <span class="o">=</span> <span class="p">{}</span></div><div class='line' id='LC39'>	<span class="n">a</span><span class="p">.</span><span class="n">img</span> <span class="o">=</span> <span class="n">image</span></div><div class='line' id='LC40'>	<span class="n">a</span><span class="p">.</span><span class="n">frames</span> <span class="o">=</span> <span class="p">{}</span></div><div class='line' id='LC41'>	<span class="n">a</span><span class="p">.</span><span class="n">delays</span> <span class="o">=</span> <span class="p">{}</span></div><div class='line' id='LC42'>	<span class="n">a</span><span class="p">.</span><span class="n">timer</span> <span class="o">=</span> <span class="mi">0</span></div><div class='line' id='LC43'>	<span class="n">a</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC44'>	<span class="n">a</span><span class="p">.</span><span class="n">fw</span> <span class="o">=</span> <span class="n">fw</span></div><div class='line' id='LC45'>	<span class="n">a</span><span class="p">.</span><span class="n">fh</span> <span class="o">=</span> <span class="n">fh</span></div><div class='line' id='LC46'>	<span class="n">a</span><span class="p">.</span><span class="n">playing</span> <span class="o">=</span> <span class="kc">true</span></div><div class='line' id='LC47'>	<span class="n">a</span><span class="p">.</span><span class="n">speed</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC48'>	<span class="n">a</span><span class="p">.</span><span class="n">mode</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC49'>	<span class="n">a</span><span class="p">.</span><span class="n">direction</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC50'>	<span class="kd">local</span> <span class="n">imgw</span> <span class="o">=</span> <span class="n">image</span><span class="p">:</span><span class="n">getWidth</span><span class="p">()</span></div><div class='line' id='LC51'>	<span class="kd">local</span> <span class="n">imgh</span> <span class="o">=</span> <span class="n">image</span><span class="p">:</span><span class="n">getHeight</span><span class="p">()</span></div><div class='line' id='LC52'>	<span class="k">if</span> <span class="n">frames</span> <span class="o">==</span> <span class="mi">0</span> <span class="k">then</span></div><div class='line' id='LC53'>		<span class="n">frames</span> <span class="o">=</span> <span class="n">imgw</span> <span class="o">/</span> <span class="n">fw</span> <span class="o">*</span> <span class="n">imgh</span> <span class="o">/</span> <span class="n">fh</span></div><div class='line' id='LC54'>	<span class="k">end</span></div><div class='line' id='LC55'>	<span class="kd">local</span> <span class="n">rowsize</span> <span class="o">=</span> <span class="n">imgw</span><span class="o">/</span><span class="n">fw</span></div><div class='line' id='LC56'>	<span class="k">for</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">frames</span> <span class="k">do</span></div><div class='line' id='LC57'>		<span class="kd">local</span> <span class="n">row</span> <span class="o">=</span> <span class="nb">math.floor</span><span class="p">((</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="n">rowsize</span><span class="p">)</span></div><div class='line' id='LC58'>		<span class="kd">local</span> <span class="n">column</span> <span class="o">=</span> <span class="p">(</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">%</span><span class="n">rowsize</span></div><div class='line' id='LC59'>		<span class="kd">local</span> <span class="n">frame</span> <span class="o">=</span> <span class="n">love</span><span class="p">.</span><span class="n">graphics</span><span class="p">.</span><span class="n">newQuad</span><span class="p">(</span><span class="n">column</span><span class="o">*</span><span class="n">fw</span><span class="p">,</span> <span class="n">row</span><span class="o">*</span><span class="n">fh</span><span class="p">,</span> <span class="n">fw</span><span class="p">,</span> <span class="n">fh</span><span class="p">,</span> <span class="n">imgw</span><span class="p">,</span> <span class="n">imgh</span><span class="p">)</span></div><div class='line' id='LC60'>		<span class="nb">table.insert</span><span class="p">(</span><span class="n">a</span><span class="p">.</span><span class="n">frames</span><span class="p">,</span> <span class="n">frame</span><span class="p">)</span></div><div class='line' id='LC61'>		<span class="nb">table.insert</span><span class="p">(</span><span class="n">a</span><span class="p">.</span><span class="n">delays</span><span class="p">,</span> <span class="n">delay</span><span class="p">)</span></div><div class='line' id='LC62'>	<span class="k">end</span></div><div class='line' id='LC63'>	<span class="k">return</span> <span class="nb">setmetatable</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">animation</span><span class="p">)</span></div><div class='line' id='LC64'><span class="k">end</span></div><div class='line' id='LC65'><br/></div><div class='line' id='LC66'><span class="c1">--- Update the animation</span></div><div class='line' id='LC67'><span class="c1">-- @param dt Time that has passed since last call</span></div><div class='line' id='LC68'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">update</span><span class="p">(</span><span class="n">dt</span><span class="p">)</span></div><div class='line' id='LC69'>	<span class="k">if</span> <span class="ow">not</span> <span class="n">self</span><span class="p">.</span><span class="n">playing</span> <span class="k">then</span> <span class="k">return</span> <span class="k">end</span></div><div class='line' id='LC70'>	<span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">+</span> <span class="n">dt</span> <span class="o">*</span> <span class="n">self</span><span class="p">.</span><span class="n">speed</span></div><div class='line' id='LC71'>	<span class="k">if</span> <span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">&gt;</span> <span class="n">self</span><span class="p">.</span><span class="n">delays</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">position</span><span class="p">]</span> <span class="k">then</span></div><div class='line' id='LC72'>		<span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">-</span> <span class="n">self</span><span class="p">.</span><span class="n">delays</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">position</span><span class="p">]</span></div><div class='line' id='LC73'>		<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">*</span> <span class="n">self</span><span class="p">.</span><span class="n">direction</span></div><div class='line' id='LC74'>		<span class="k">if</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">&gt;</span> <span class="o">#</span><span class="n">self</span><span class="p">.</span><span class="n">frames</span> <span class="k">then</span></div><div class='line' id='LC75'>			<span class="k">if</span> <span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">==</span> <span class="mi">1</span> <span class="k">then</span></div><div class='line' id='LC76'>				<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC77'>			<span class="k">elseif</span> <span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">==</span> <span class="mi">2</span> <span class="k">then</span></div><div class='line' id='LC78'>				<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">-</span> <span class="mi">1</span></div><div class='line' id='LC79'>				<span class="n">self</span><span class="p">:</span><span class="n">stop</span><span class="p">()</span></div><div class='line' id='LC80'>			<span class="k">elseif</span> <span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">==</span> <span class="mi">3</span> <span class="k">then</span></div><div class='line' id='LC81'>				<span class="n">self</span><span class="p">.</span><span class="n">direction</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span></div><div class='line' id='LC82'>				<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">-</span> <span class="mi">1</span></div><div class='line' id='LC83'>			<span class="k">end</span></div><div class='line' id='LC84'>		<span class="k">elseif</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">&lt;</span> <span class="mi">1</span> <span class="ow">and</span> <span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">==</span> <span class="mi">3</span> <span class="k">then</span></div><div class='line' id='LC85'>			<span class="n">self</span><span class="p">.</span><span class="n">direction</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC86'>			<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">+</span> <span class="mi">1</span></div><div class='line' id='LC87'>		<span class="k">end</span></div><div class='line' id='LC88'>	<span class="k">end</span></div><div class='line' id='LC89'><span class="k">end</span></div><div class='line' id='LC90'><br/></div><div class='line' id='LC91'><span class="c1">--- Draw the animation</span></div><div class='line' id='LC92'><span class="c1">-- @param x The X coordinate</span></div><div class='line' id='LC93'><span class="c1">-- @param y The Y coordinate</span></div><div class='line' id='LC94'><span class="c1">-- @param angle The angle to draw at (radians)</span></div><div class='line' id='LC95'><span class="c1">-- @param sx The scale on the X axis</span></div><div class='line' id='LC96'><span class="c1">-- @param sy The scale on the Y axis</span></div><div class='line' id='LC97'><span class="c1">-- @param ox The X coordinate of the origin</span></div><div class='line' id='LC98'><span class="c1">-- @param oy The Y coordinate of the origin</span></div><div class='line' id='LC99'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">draw</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">angle</span><span class="p">,</span> <span class="n">sx</span><span class="p">,</span> <span class="n">sy</span><span class="p">,</span> <span class="n">ox</span><span class="p">,</span> <span class="n">oy</span><span class="p">)</span></div><div class='line' id='LC100'>	<span class="n">love</span><span class="p">.</span><span class="n">graphics</span><span class="p">.</span><span class="n">drawq</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">img</span><span class="p">,</span> <span class="n">self</span><span class="p">.</span><span class="n">frames</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">position</span><span class="p">],</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">angle</span><span class="p">,</span> <span class="n">sx</span><span class="p">,</span> <span class="n">sy</span><span class="p">,</span> <span class="n">ox</span><span class="p">,</span> <span class="n">oy</span><span class="p">)</span></div><div class='line' id='LC101'><span class="k">end</span></div><div class='line' id='LC102'><br/></div><div class='line' id='LC103'><span class="c1">--- Add a frame</span></div><div class='line' id='LC104'><span class="c1">-- @param x The X coordinate of the frame on the original image</span></div><div class='line' id='LC105'><span class="c1">-- @param y The Y coordinate of the frame on the original image</span></div><div class='line' id='LC106'><span class="c1">-- @param w The width of the frame</span></div><div class='line' id='LC107'><span class="c1">-- @param h The height of the frame</span></div><div class='line' id='LC108'><span class="c1">-- @param delay The delay before the next frame is shown</span></div><div class='line' id='LC109'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">addFrame</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">w</span><span class="p">,</span> <span class="n">h</span><span class="p">,</span> <span class="n">delay</span><span class="p">)</span></div><div class='line' id='LC110'>	<span class="kd">local</span> <span class="n">frame</span> <span class="o">=</span> <span class="n">love</span><span class="p">.</span><span class="n">graphics</span><span class="p">.</span><span class="n">newQuad</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">w</span><span class="p">,</span> <span class="n">h</span><span class="p">,</span> <span class="n">self</span><span class="p">.</span><span class="n">img</span><span class="p">:</span><span class="n">getWidth</span><span class="p">(),</span> <span class="n">self</span><span class="p">.</span><span class="n">img</span><span class="p">:</span><span class="n">getHeight</span><span class="p">())</span></div><div class='line' id='LC111'>	<span class="nb">table.insert</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">frames</span><span class="p">,</span> <span class="n">frame</span><span class="p">)</span></div><div class='line' id='LC112'>	<span class="nb">table.insert</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">delays</span><span class="p">,</span> <span class="n">delay</span><span class="p">)</span></div><div class='line' id='LC113'><span class="k">end</span></div><div class='line' id='LC114'><br/></div><div class='line' id='LC115'><span class="c1">--- Play the animation</span></div><div class='line' id='LC116'><span class="c1">-- Starts it if it was stopped.</span></div><div class='line' id='LC117'><span class="c1">-- Basically makes sure it uses the delays</span></div><div class='line' id='LC118'><span class="c1">-- to switch to the next frame.</span></div><div class='line' id='LC119'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">play</span><span class="p">()</span></div><div class='line' id='LC120'>	<span class="n">self</span><span class="p">.</span><span class="n">playing</span> <span class="o">=</span> <span class="kc">true</span></div><div class='line' id='LC121'><span class="k">end</span></div><div class='line' id='LC122'><br/></div><div class='line' id='LC123'><span class="c1">--- Stop the animation</span></div><div class='line' id='LC124'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">stop</span><span class="p">()</span></div><div class='line' id='LC125'>	<span class="n">self</span><span class="p">.</span><span class="n">playing</span> <span class="o">=</span> <span class="kc">false</span></div><div class='line' id='LC126'><span class="k">end</span></div><div class='line' id='LC127'><br/></div><div class='line' id='LC128'><span class="c1">--- Reset</span></div><div class='line' id='LC129'><span class="c1">-- Go back to the first frame.</span></div><div class='line' id='LC130'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">reset</span><span class="p">()</span></div><div class='line' id='LC131'>	<span class="n">self</span><span class="p">:</span><span class="n">seek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span></div><div class='line' id='LC132'><span class="k">end</span></div><div class='line' id='LC133'><br/></div><div class='line' id='LC134'><span class="c1">--- Seek to a frame</span></div><div class='line' id='LC135'><span class="c1">-- @param frame The frame to display now</span></div><div class='line' id='LC136'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">seek</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span></div><div class='line' id='LC137'>	<span class="n">self</span><span class="p">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">frame</span></div><div class='line' id='LC138'>	<span class="n">self</span><span class="p">.</span><span class="n">timer</span> <span class="o">=</span> <span class="mi">0</span></div><div class='line' id='LC139'><span class="k">end</span></div><div class='line' id='LC140'><br/></div><div class='line' id='LC141'><span class="c1">--- Get the currently shown frame</span></div><div class='line' id='LC142'><span class="c1">-- @return The current frame</span></div><div class='line' id='LC143'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">getCurrentFrame</span><span class="p">()</span></div><div class='line' id='LC144'>	<span class="k">return</span> <span class="n">self</span><span class="p">.</span><span class="n">position</span></div><div class='line' id='LC145'><span class="k">end</span></div><div class='line' id='LC146'><br/></div><div class='line' id='LC147'><span class="c1">--- Get the number of frames</span></div><div class='line' id='LC148'><span class="c1">-- @return The number of frames</span></div><div class='line' id='LC149'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">getSize</span><span class="p">()</span></div><div class='line' id='LC150'>	<span class="k">return</span> <span class="o">#</span><span class="n">self</span><span class="p">.</span><span class="n">frames</span></div><div class='line' id='LC151'><span class="k">end</span></div><div class='line' id='LC152'><br/></div><div class='line' id='LC153'><span class="c1">--- Set the delay between frames</span></div><div class='line' id='LC154'><span class="c1">-- @param frame Which frame to set the delay for</span></div><div class='line' id='LC155'><span class="c1">-- @param delay The delay</span></div><div class='line' id='LC156'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">setDelay</span><span class="p">(</span><span class="n">frame</span><span class="p">,</span> <span class="n">delay</span><span class="p">)</span></div><div class='line' id='LC157'>	<span class="n">self</span><span class="p">.</span><span class="n">delays</span><span class="p">[</span><span class="n">frame</span><span class="p">]</span> <span class="o">=</span> <span class="n">delay</span></div><div class='line' id='LC158'><span class="k">end</span></div><div class='line' id='LC159'><br/></div><div class='line' id='LC160'><span class="c1">--- Set the speed</span></div><div class='line' id='LC161'><span class="c1">-- @param speed The speed to play at (1 is normal, 2 is double, etc)</span></div><div class='line' id='LC162'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">setSpeed</span><span class="p">(</span><span class="n">speed</span><span class="p">)</span></div><div class='line' id='LC163'>	<span class="n">self</span><span class="p">.</span><span class="n">speed</span> <span class="o">=</span> <span class="n">speed</span></div><div class='line' id='LC164'><span class="k">end</span></div><div class='line' id='LC165'><br/></div><div class='line' id='LC166'><span class="c1">--- Get the width of the current frame</span></div><div class='line' id='LC167'><span class="c1">-- @return The width of the current frame</span></div><div class='line' id='LC168'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">getWidth</span><span class="p">()</span></div><div class='line' id='LC169'>	<span class="k">return</span> <span class="n">self</span><span class="p">.</span><span class="n">frames</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">position</span><span class="p">]:</span><span class="n">getWidth</span><span class="p">()</span></div><div class='line' id='LC170'><span class="k">end</span></div><div class='line' id='LC171'><br/></div><div class='line' id='LC172'><span class="c1">--- Get the height of the current frame</span></div><div class='line' id='LC173'><span class="c1">-- @return The height of the current frame</span></div><div class='line' id='LC174'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">getHeight</span><span class="p">()</span></div><div class='line' id='LC175'>	<span class="k">return</span> <span class="n">self</span><span class="p">.</span><span class="n">frames</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">position</span><span class="p">]:</span><span class="n">getHeight</span><span class="p">()</span></div><div class='line' id='LC176'><span class="k">end</span></div><div class='line' id='LC177'><br/></div><div class='line' id='LC178'><span class="c1">--- Set the play mode</span></div><div class='line' id='LC179'><span class="c1">-- Could be &quot;loop&quot; to loop it, &quot;once&quot; to play it once, or &quot;bounce&quot; to play it, reverse it, and play it again (looping)</span></div><div class='line' id='LC180'><span class="c1">-- @param mode The mode: one of the above</span></div><div class='line' id='LC181'><span class="k">function</span> <span class="nf">animation</span><span class="p">:</span><span class="n">setMode</span><span class="p">(</span><span class="n">mode</span><span class="p">)</span></div><div class='line' id='LC182'>	<span class="k">if</span> <span class="n">mode</span> <span class="o">==</span> <span class="s2">&quot;</span><span class="s">loop&quot;</span> <span class="k">then</span></div><div class='line' id='LC183'>		<span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">=</span> <span class="mi">1</span></div><div class='line' id='LC184'>	<span class="k">elseif</span> <span class="n">mode</span> <span class="o">==</span> <span class="s2">&quot;</span><span class="s">once&quot;</span> <span class="k">then</span></div><div class='line' id='LC185'>		<span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">=</span> <span class="mi">2</span></div><div class='line' id='LC186'>	<span class="k">elseif</span> <span class="n">mode</span> <span class="o">==</span> <span class="s2">&quot;</span><span class="s">bounce&quot;</span> <span class="k">then</span></div><div class='line' id='LC187'>		<span class="n">self</span><span class="p">.</span><span class="n">mode</span> <span class="o">=</span> <span class="mi">3</span></div><div class='line' id='LC188'>	<span class="k">end</span></div><div class='line' id='LC189'><span class="k">end</span></div><div class='line' id='LC190'><br/></div><div class='line' id='LC191'><span class="c1">--- Animations_legacy_support</span></div><div class='line' id='LC192'><span class="c1">-- @usage Add legacy support, basically set love.graphics.newAnimation again, and allow you to use love.graphics.draw</span></div><div class='line' id='LC193'><span class="k">if</span> <span class="n">Animations_legacy_support</span> <span class="k">then</span></div><div class='line' id='LC194'>	<span class="n">love</span><span class="p">.</span><span class="n">graphics</span><span class="p">.</span><span class="n">newAnimation</span> <span class="o">=</span> <span class="n">newAnimation</span></div><div class='line' id='LC195'>	<span class="kd">local</span> <span class="n">oldLGDraw</span> <span class="o">=</span> <span class="n">love</span><span class="p">.</span><span class="n">graphics</span><span class="p">.</span><span class="n">draw</span></div><div class='line' id='LC196'>	<span class="k">function</span> <span class="nc">love</span><span class="p">.</span><span class="nf">graphics</span><span class="p">.</span><span class="n">draw</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="o">..</span><span class="p">.)</span></div><div class='line' id='LC197'>		<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">item</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;</span><span class="s">table&quot;</span> <span class="ow">and</span> <span class="n">item</span><span class="p">.</span><span class="n">draw</span> <span class="k">then</span></div><div class='line' id='LC198'>			<span class="n">item</span><span class="p">:</span><span class="n">draw</span><span class="p">(</span><span class="o">..</span><span class="p">.)</span></div><div class='line' id='LC199'>		<span class="k">else</span></div><div class='line' id='LC200'>			<span class="n">oldLGDraw</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="o">..</span><span class="p">.)</span></div><div class='line' id='LC201'>		<span class="k">end</span></div><div class='line' id='LC202'>	<span class="k">end</span></div><div class='line' id='LC203'><span class="k">end</span></div></pre></div>
          </td>
        </tr>
      </table>
  </div>

          </div>
        </div>
      </div>
    </div>

  </div>

<div class="frame frame-loading" style="display:none;" data-tree-list-url="/bartbes/love-misc-libs/tree-list/88979a881b39efbe4a43707012baf3fffd6eb462" data-blob-url-prefix="/bartbes/love-misc-libs/blob/88979a881b39efbe4a43707012baf3fffd6eb462">
  <img src="https://a248.e.akamai.net/assets.github.com/images/modules/ajax/big_spinner_336699.gif?1310104853" height="32" width="32">
</div>

      </div>
      <div class="context-overlay"></div>
    </div>


      <!-- footer -->
      <div id="footer" >
        
  <div class="upper_footer">
     <div class="container clearfix">

       <!--[if IE]><h4 id="blacktocat_ie">GitHub Links</h4><![endif]-->
       <![if !IE]><h4 id="blacktocat">GitHub Links</h4><![endif]>

       <ul class="footer_nav">
         <h4>GitHub</h4>
         <li><a href="https://github.com/about">About</a></li>
         <li><a href="https://github.com/blog">Blog</a></li>
         <li><a href="https://github.com/features">Features</a></li>
         <li><a href="https://github.com/contact">Contact &amp; Support</a></li>
         <li><a href="https://github.com/training">Training</a></li>
         <li><a href="http://enterprise.github.com/">GitHub Enterprise</a></li>
         <li><a href="http://status.github.com/">Site Status</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Tools</h4>
         <li><a href="http://get.gaug.es/">Gauges: Analyze web traffic</a></li>
         <li><a href="http://speakerdeck.com">Speaker Deck: Presentations</a></li>
         <li><a href="https://gist.github.com">Gist: Code snippets</a></li>
         <li><a href="http://mac.github.com/">GitHub for Mac</a></li>
         <li><a href="http://mobile.github.com/">Issues for iPhone</a></li>
         <li><a href="http://jobs.github.com/">Job Board</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Extras</h4>
         <li><a href="http://shop.github.com/">GitHub Shop</a></li>
         <li><a href="http://octodex.github.com/">The Octodex</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Documentation</h4>
         <li><a href="http://help.github.com/">GitHub Help</a></li>
         <li><a href="http://developer.github.com/">Developer API</a></li>
         <li><a href="http://github.github.com/github-flavored-markdown/">GitHub Flavored Markdown</a></li>
         <li><a href="http://pages.github.com/">GitHub Pages</a></li>
       </ul>

     </div><!-- /.site -->
  </div><!-- /.upper_footer -->

<div class="lower_footer">
  <div class="container clearfix">
    <!--[if IE]><div id="legal_ie"><![endif]-->
    <![if !IE]><div id="legal"><![endif]>
      <ul>
          <li><a href="https://github.com/site/terms">Terms of Service</a></li>
          <li><a href="https://github.com/site/privacy">Privacy</a></li>
          <li><a href="https://github.com/security">Security</a></li>
      </ul>

      <p>&copy; 2012 <span title="0.05846s from fe8.rs.github.com">GitHub</span> Inc. All rights reserved.</p>
    </div><!-- /#legal or /#legal_ie-->

      <div class="sponsor">
        <a href="http://www.rackspace.com" class="logo">
          <img alt="Dedicated Server" height="36" src="https://a248.e.akamai.net/assets.github.com/images/modules/footer/rackspaces_logo.png?1329521041" width="38" />
        </a>
        Powered by the <a href="http://www.rackspace.com ">Dedicated
        Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
        Computing</a> of Rackspace Hosting<span>&reg;</span>
      </div>
  </div><!-- /.site -->
</div><!-- /.lower_footer -->

      </div><!-- /#footer -->

    

<div id="keyboard_shortcuts_pane" class="instapaper_ignore readability-extra" style="display:none">
  <h2>Keyboard Shortcuts <small><a href="#" class="js-see-all-keyboard-shortcuts">(see all)</a></small></h2>

  <div class="columns threecols">
    <div class="column first">
      <h3>Site wide shortcuts</h3>
      <dl class="keyboard-mappings">
        <dt>s</dt>
        <dd>Focus site search</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>?</dt>
        <dd>Bring up this help dialog</dd>
      </dl>
    </div><!-- /.column.first -->

    <div class="column middle" style='display:none'>
      <h3>Commit list</h3>
      <dl class="keyboard-mappings">
        <dt>j</dt>
        <dd>Move selection down</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>k</dt>
        <dd>Move selection up</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>c <em>or</em> o <em>or</em> enter</dt>
        <dd>Open commit</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>y</dt>
        <dd>Expand URL to its canonical form</dd>
      </dl>
    </div><!-- /.column.first -->

    <div class="column last" style='display:none'>
      <h3>Pull request list</h3>
      <dl class="keyboard-mappings">
        <dt>j</dt>
        <dd>Move selection down</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>k</dt>
        <dd>Move selection up</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>o <em>or</em> enter</dt>
        <dd>Open issue</dd>
      </dl>
    </div><!-- /.columns.last -->

  </div><!-- /.columns.equacols -->

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Issues</h3>

    <div class="columns threecols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt>j</dt>
          <dd>Move selection down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>k</dt>
          <dd>Move selection up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>x</dt>
          <dd>Toggle selection</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>o <em>or</em> enter</dt>
          <dd>Open issue</dd>
        </dl>
      </div><!-- /.column.first -->
      <div class="column middle">
        <dl class="keyboard-mappings">
          <dt>I</dt>
          <dd>Mark selection as read</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>U</dt>
          <dd>Mark selection as unread</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>e</dt>
          <dd>Close selection</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>y</dt>
          <dd>Remove selection from view</dd>
        </dl>
      </div><!-- /.column.middle -->
      <div class="column last">
        <dl class="keyboard-mappings">
          <dt>c</dt>
          <dd>Create issue</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>l</dt>
          <dd>Create label</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>i</dt>
          <dd>Back to inbox</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>u</dt>
          <dd>Back to issues</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>/</dt>
          <dd>Focus issues search</dd>
        </dl>
      </div>
    </div>
  </div>

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Issues Dashboard</h3>

    <div class="columns threecols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt>j</dt>
          <dd>Move selection down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>k</dt>
          <dd>Move selection up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>o <em>or</em> enter</dt>
          <dd>Open issue</dd>
        </dl>
      </div><!-- /.column.first -->
    </div>
  </div>

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Network Graph</h3>
    <div class="columns equacols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt><span class="badmono">←</span> <em>or</em> h</dt>
          <dd>Scroll left</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">→</span> <em>or</em> l</dt>
          <dd>Scroll right</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">↑</span> <em>or</em> k</dt>
          <dd>Scroll up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">↓</span> <em>or</em> j</dt>
          <dd>Scroll down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>t</dt>
          <dd>Toggle visibility of head labels</dd>
        </dl>
      </div><!-- /.column.first -->
      <div class="column last">
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">←</span> <em>or</em> shift h</dt>
          <dd>Scroll all the way left</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">→</span> <em>or</em> shift l</dt>
          <dd>Scroll all the way right</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">↑</span> <em>or</em> shift k</dt>
          <dd>Scroll all the way up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">↓</span> <em>or</em> shift j</dt>
          <dd>Scroll all the way down</dd>
        </dl>
      </div><!-- /.column.last -->
    </div>
  </div>

  <div >
    <div class="rule"></div>
    <div class="columns threecols">
      <div class="column first" >
        <h3>Source Code Browsing</h3>
        <dl class="keyboard-mappings">
          <dt>t</dt>
          <dd>Activates the file finder</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>l</dt>
          <dd>Jump to line</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>w</dt>
          <dd>Switch branch/tag</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>y</dt>
          <dd>Expand URL to its canonical form</dd>
        </dl>
      </div>
    </div>
  </div>
</div>

    <div id="markdown-help" class="instapaper_ignore readability-extra">
  <h2>Markdown Cheat Sheet</h2>

  <div class="cheatsheet-content">

  <div class="mod">
    <div class="col">
      <h3>Format Text</h3>
      <p>Headers</p>
      <pre>
# This is an &lt;h1&gt; tag
## This is an &lt;h2&gt; tag
###### This is an &lt;h6&gt; tag</pre>
     <p>Text styles</p>
     <pre>
*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__

*You **can** combine them*
</pre>
    </div>
    <div class="col">
      <h3>Lists</h3>
      <p>Unordered</p>
      <pre>
* Item 1
* Item 2
  * Item 2a
  * Item 2b</pre>
     <p>Ordered</p>
     <pre>
1. Item 1
2. Item 2
3. Item 3
   * Item 3a
   * Item 3b</pre>
    </div>
    <div class="col">
      <h3>Miscellaneous</h3>
      <p>Images</p>
      <pre>
![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)
</pre>
     <p>Links</p>
     <pre>
http://github.com - automatic!
[GitHub](http://github.com)</pre>
<p>Blockquotes</p>
     <pre>
As Kanye West said:

> We're living the future so
> the present is our past.
</pre>
    </div>
  </div>
  <div class="rule"></div>

  <h3>Code Examples in Markdown</h3>
  <div class="col">
      <p>Syntax highlighting with <a href="http://github.github.com/github-flavored-markdown/" title="GitHub Flavored Markdown" target="_blank">GFM</a></p>
      <pre>
```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```</pre>
    </div>
    <div class="col">
      <p>Or, indent your code 4 spaces</p>
      <pre>
Here is a Python code example
without syntax highlighting:

    def foo:
      if not bar:
        return true</pre>
    </div>
    <div class="col">
      <p>Inline code for comments</p>
      <pre>
I think you should use an
`&lt;addr&gt;` element here instead.</pre>
    </div>
  </div>

  </div>
</div>


    <div class="ajax-error-message">
      <p><span class="icon"></span> Something went wrong with that request. Please try again. <a href="javascript:;" class="ajax-error-dismiss">Dismiss</a></p>
    </div>

    
    
    
    <span id='server_response_time' data-time='0.05999' data-host='fe8'></span>
  </body>
</html>

